#pragma once
/***********************************************************************************************
COPYRIGHT 2011 Mafahir Fairoze

This file is part of Neural++.
(Project Website : http://mafahir.wordpress.com/projects/neuralplusplus)

Neural++ is a free software. You can redistribute it and/or modify it under the terms of
the GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.

Neural++ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License <http://www.gnu.org/licenses/> for more details.

***********************************************************************************************/
#include "../Network.h"
#include "PositionNeuron.h"
#include "KohonenLayer.h"

namespace NeuralPlusPlus
	{
	namespace Core
		{
		namespace SOM

			{
			/// <summary>
			/// This class extends a <see cref="Network"/> and represents a Kohonen Self-Organizing Map.
			/// </summary>
			class KohonenNetwork : public Network
				{
				/// <summary>
				/// Gets the winner neuron of the network
				/// </summary>
				public: PositionNeuron* Winner();

						/// <summary>
						/// Creates a new Kohonen SOM, with the specified input and output layers. (You are required
						/// to connect all layers using appropriate synapses, before using the constructor. Any changes
						/// made to the structure of the network here-after, may lead to complete malfunctioning of the
						/// network)
						/// </summary>
				public: KohonenNetwork(KohonenLayer *inputLayer, KohonenLayer *outputLayer);

						/// <summary>
						/// A protected: helper function used to train single learning sample
						/// </summary>
				protected: void LearnSample(TrainingSample *trainingSample, int currentIteration, int trainingEpochs) override;
				};
			}
		}
	}